#include "Mediator.h"
#include "Colleage.h"

#include <typeinfo>

using namespace std;

Mediator::Mediator(){}
Mediator::~Mediator(){}

ConcreteMediator::ConcreteMediator(){}
ConcreteMediator::~ConcreteMediator(){}

void ConcreteMediator::Send(string message, Colleage* colleage){
	string sName = colleage->GetClassName();
	if (sName.compare("ConcreteColleage1") == 0)
	{
		_concreteColleage2->Notify(message);
	} 
	else
	{
		_concreteColleage1->Notify(message);
	}
}

void ConcreteMediator::SetConcreteColleage1(ConcreteColleage1* concreteColleage1){
	_concreteColleage1 = concreteColleage1;
}

void ConcreteMediator::SetConcreteColleage2(ConcreteColleage2* concreteColleage2){
	_concreteColleage2 = concreteColleage2;
}
